// routes
import routes from "./modules";
// layout
import BottomBar from "@/views/components/BottomView/Index.vue";
import HeaderBar from "@/views/components/HeaderView/Index.vue";
import {Info} from "vant";


// common
const page404 = () => import("@/views/404.vue");
const WxLogin = () => import("@/views/WxLogin.vue");

// BottomBar
const Home = () => import("@/views/pages/Home.vue");
const PersonCenter = () => import("@/views/pages/PersonCenter.vue");
const MapDemo = () => import("@/views/pages/MapDemo.vue");
const ShopCart = () => import("@/views/pages/car/ShopCart.vue")

const Kinds = () => import("@/views/pages/kinds/Kinds.vue")

const Infor = () => import("@/views/pages/infor/Personal.vue")

const Index = () => import("@/views/pages/index/Index.vue")

const Goods = () => import("@/views/pages/goods/Goods.vue")
const MyCollect = () => import("@/views/pages/infor/MyCollect")
const register = () => import("@/views/register.vue")

const Coupon = () => import("@/views/pages/coupon/Coupon.vue")
const Search = () => import("@/views/pages/index/Search.vue")
const SecKill = () => import("@/views/pages/seckill/SecKill")
const MyAccountSetting = () => import("@/views/pages/infor/MyAccountSetting")
const MyAddress = () => import("@/views/pages/infor/MyAddress")
const AccountSecurity = () => import("@/views/pages/infor/AccountSecurity")
const ModifyPassword = () => import("@/views/pages/infor/ModifyPassword")
const FinalPassword = () => import("@/views/pages/infor/FinalPassword")
const OrderStatus = () => import("@/views/pages/order/OrderStatus")
const Active = () => import("@/views/pages/active/Active")
// 注意
// meta: {
//   isOpen: true // 默认所有页面都是要权限的,配置isOpen:true 设置无需权限访问
// }
const routesArr = [
    {
        path: "*",
        name: "page404",
        meta: {
            title: "页面未找到",
            isOpen: true,
        },
        component: page404,
    },
    {
        path: "/",
        name: "main",
        redirect: "/index",
        component: BottomBar,
        children: [
            {
                path: "Index",
                name: "Index",
                meta: {
                    title: "首页",
                },
                component: Index,
            },
            {
                path: "Kinds",
                name: "Kinds",
                meta: {
                    title: "分类",
                    isOpen: true,
                },
                component: Kinds,
            },
            {
                path: "shopCart",
                name: "ShopCart",
                meta: {
                    title: "购物车",
                },
                component: ShopCart,
            },
            {
                path: "/infor",
                name: "Infor",
                meta: {
                    title: "我的",
                },
                component: Infor,
            },
            {
                path: "coupon",
                name: "coupon",
                hidden: true,
                meta: {
                    title: "优惠卷",
                },
                component: Coupon,
            }
        ],
    },
    {
        path: "/myCollect",
        name: "MyCollect",
        meta: {
            title: "我的收藏",
            isOpen: true,
        },
        component: MyCollect,
    },
    {
        path: "/login",
        name: "login",
        meta: {
            title: "登录",
            isOpen: true,
        },

        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () =>
            import(/* webpackChunkName: "login" */ "@/views/Login.vue"),
    },
    {
        path: "/register",
        name: "register",
        meta: {
            title: "注册",
            isOpen: true,
        },
        component: () =>
            import("@/views/register.vue"),
    },
    {
        path: "/WxLogin",
        name: "WxLogin",
        meta: {
            title: "微信登录",
            isOpen: true,
        },
        component: WxLogin,
    },
    {
        path: "/goods",
        name: "Goods",
        component: Goods,
    },
    {
        path: "/search",
        name: "Search",
        component: Search,
    }, {
        path: "/myAccountSetting",
        name: "MyAccountSetting",
        component: MyAccountSetting
    }, {
        path: "/myAddress",
        name: MyAddress,
        component: MyAddress
    }, {
        path: "/secKill",
        name: "SecKill",
        component: SecKill
    },
    {
        path: "/AccountSecurity",
        name: AccountSecurity,
        component: AccountSecurity
    },
    {
        path: "/ModifyPassword",
        name: ModifyPassword,
        component: ModifyPassword
    },
    {
        path: "/FinalPassword",
        name: FinalPassword,
        component: FinalPassword
    },

    {
        path: "/OrderStatus/:status",
        name: OrderStatus,
        component: OrderStatus
    }, {
        path: "/active",
        name: Active,
        component: Active
    }

];
export default routesArr;
